
CC = gcc
EXE = cherrytree
SRCS = $(wildcard src/*.c)

OBJS = ${SRCS:.c=.o}

LDLIBS = `pkg-config --cflags --libs gtk+-3.0`

CFLAGS = -Wall -g -Isrc

INCLUDES = $(wildcard src/*.h)

# $^ is INPUTS: all the explicit dependencies of the target
# $< is INPUT: the first explicit dependency of the rule
# $@ is OUTPUT: the target of the current rule

$(EXE): $(OBJS)
	$(CC) $(LDLIBS) $^ -o $@

%.o: %.c ${INCLUDES}
	$(CC) $(CFLAGS) $(LDLIBS) -c $< -o $@

clean:
	rm -f $(OBJS)
	rm -f cherrytree
